home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / asmutil / as05_103.zip / AS05.MAN < prev    next >
Text File  |  1994-05-10  |  23KB  |  617 lines

  1. Kingswood Software Development Tools                                 AS05
  2. -------------------------------------------------------------------------
  3.  
  4. NAME
  5.    as05 - optimizing assembler for M6805 microprocessor.
  6.  
  7.  
  8. SYNOPSIS
  9.    as05 [-chlnopqstvwz] file
  10.  
  11.  
  12. DESCRIPTION
  13.    This documentation is for as05 [1.03].
  14.    Copyright 1990-1994, Frank A. Vorstenbosch, Kingswood Software
  15.  
  16.    AS05 is an optimizing assembler for the Motorola 6805 microprocessor.
  17.    It reads input from an ASCII text file, assembles this into memory, and
  18.    then writes a listing and a binary or hex file.
  19.  
  20.    AS05 is case sensitive, not only does it differentiate between the
  21.    labels XYZ and xyz, but it also requires all (pseudo) instruction and
  22.    register names to be lower case.  This way, the listing is the most
  23.    readable.  Option -i can be used to make the assembler case insensitive.
  24.  
  25.  
  26. OPTIONS
  27.    As05 recognizes the following options:
  28.  
  29.       -c   Show number of cycles per instruction in listing.  This
  30.            decreases the number of columns available for listing by 5.
  31.            The number of cycles is printed between brackets [ and ].
  32.  
  33.       -h<lines>
  34.            Specify height of page for listing.  This option determines
  35.            the number of lines per printed page.  Each page has a header
  36.            and is terminated by a form-feed character.
  37.  
  38.       -i   Ignore case in opcodes.  In this way, the assembler does not
  39.            differentiate between 'add' and 'ADD', for example.  Labels
  40.            are still case sensitive.
  41.  
  42.       -l   Generate pass 2 listing.
  43.  
  44.       -l<filename>
  45.             Listing file name.  The listing file is used for pass 1 and
  46.             pass 2 listing, for the symbol table (printed between the
  47.             two passes), and some statistics.  When neither -p nor -t
  48.             is specified, and -l<filename> is given, then the assembler
  49.             automatically generates a pass 2 listing.  When -p or -t is
  50.             specified, an additional -l should be given is a pass 2
  51.             listing is required.
  52.  
  53.       -l   Generate pass 2 listing.
  54.  
  55.       -n   Disable optimizations.  When this option is specified no
  56.            optimizations will be done, even when the _opt_ pseudo-
  57.            instruction is used in the source code.
  58.  
  59.       -o<filename>
  60.            Specify binary or s-records output file name.  The assembler
  61.            automatically adds ".bin" for binary output or ".s19" for
  62.            s-records output when no extension is given.
  63.  
  64.       -p   Generate pass 1 listing.  This may be used to examine any
  65.            optimizations/bugs generated in pass 2.
  66.  
  67.       -q   Quiet mode.  No running line counter is displayed on standard
  68.            error output.
  69.  
  70.       -s   Write s-records instead of binary file.  The s-records file
  71.            contains data for (only) the used memory; the binary file
  72.            begins at the lowest used address, and continues up to the
  73.            highest used address; filling unused memory between these
  74.            two addresses with either $ff or $00.
  75.  
  76.       -s2  Write intel-hex file instead of binary file.  The intel-hex
  77.            file contains data for (only) the used memory.
  78.  
  79.       -t   Generate symbol table.  The symbol table is listed between
  80.            passes one and two, displaying the name, hexadecimal and
  81.            decimal value of each label, using 4-digit hexadecimal
  82.            numbers where possible, otherwise 8-digit numbers.  The
  83.            decimal value is followed by an asterisk if the label is
  84.            redefinable (defined using _set_ instead of _equ_).
  85.  
  86.       -v   Verbose mode.  More information is displayed on standard
  87.            output.
  88.  
  89.       -w<width>
  90.            Specify column width.  Normally, the listing is printed using
  91.            79 columns for output to a 80-column screen or printer.  If
  92.            the -w option is given without a number following it, then
  93.            the listing will be 131 columns wide, otherwise it will be
  94.            the number of colulmns specified (between 60 and 200).
  95.  
  96.       -z   Fill unused memory with zeros.  Normally when a binary file
  97.            is generated, unused bytes between the lowest and highest
  98.            used addresses are filled with $ff, the unprogrammed state
  99.            of EPROMs.  If this is not wanted, the -z option can be used
  100.            to initialize this memory to $00.  With s-records, unused
  101.            memory is not output to the file, and this option forces the
  102.            creation of an S9 (start address) record, even if no start
  103.            address is specified in the file with the _end_ pseudo-
  104.            instruction.
  105.  
  106.    It is possible to discard any of the the output files by specifying
  107.    the name 'nul'.
  108.  
  109.  
  110. EXPRESSIONS
  111.  
  112.    The assembler recognizes most C-language expressions.  The operators
  113.    are listed here in order of precedence, highest first:
  114.  
  115.        ()            braces to group subexpressions
  116.        *             current location counter
  117.        unary + - ! ~ unary + (no-operation), negation, logical NOT,
  118.                      binary NOT
  119.        * / %         multiplication, division, modulo
  120.        + -           addition, subtraction
  121.        << >>         shift left, shift right
  122.        < > <= >=     comparison for greater/less than
  123.        = !=          comparison for equality (== can be used for =)
  124.        &             binary AND
  125.        ^             binary XOR
  126.        |             binary OR
  127.  
  128.    The logical NOT (!) evaluates to zero if the parameter is nonzero,
  129.    and vice versa.  The binary NOT (~) complements all the bits in its
  130.    parameter.
  131.  
  132.    Note: the asterisk is both used as the multiplication operator, and
  133.    as symbol for the current location.  The assembler determines from
  134.    the context which is which. Thus:
  135.  
  136.        5**
  137.  
  138.    is a valid expression, evaluating to five times the current location
  139.    counter, and:
  140.  
  141.        2+*/2
  142.  
  143.    is too, evaluating to the current location counter divided by two, to
  144.    which two is added.  In the same way, the % sign is both used as the
  145.    modulo operator and the prefix for binary numbers.
  146.  
  147.    Numbers can be specified in any number base between 2 and 36.
  148.    Decimal numbers can be used without a prefix, hexadecimal numbers
  149.    can be prefixed by $, octal numbers by @, and  binary numbers by %.
  150.    Other number bases can be used by using the following format:  
  151.       <base>#<number>, 
  152.    where the base is the number base to use (must be specified in 
  153.    decimal), and number is the value.  Thus:
  154.       1000    - decimal number, value 10*10*10=1000
  155.       %1000   - binary number, value 2*2*2=8
  156.       @1000   - octal number, value 8*8*8=512
  157.       $1000   - hexadecimal number, value 16*16*16=4096
  158.       2#1000  - binary number, value 2*2*2=8
  159.       4#1000  - base-4 number, value 4*4*4=64
  160.       7#1000  - base-7 number, value 7*7*7=343
  161.       36#1000 - base-36 number, value 36*36*36=444528
  162.    For number bases greater than 10, additional digits are represented
  163.    by letters, starting from A.  Both lower and upper case letters can
  164.    be used.
  165.       11#aa = 120
  166.       16#ff = 255
  167.       25#oo = 624
  168.       36#zz = 1295
  169.  
  170.  
  171. PSEUDO-INSTRUCTIONS
  172.  
  173.    align <expression>
  174.  
  175.       Align fills zero or more bytes with zeros until the new address
  176.       modulo <expression> equals zero.  If the expression is not present,
  177.       align fills zero or one bytes with zeros until the new address
  178.       is even.
  179.  
  180.       Example 1:
  181.                       align  256             ; continue assembly on the
  182.                                              ; next 256-byte page
  183.  
  184.       Example 2:
  185.                       align                  ; make sure table begins
  186.       Table           dw     1,2,3           ; on an even address
  187.  
  188.  
  189.  
  190.    bss
  191.       Put all assembled instructions and data in the code segment.
  192.       Only data pseudo-instructions can be used in the bss segment, and
  193.       these only increment the location counter.  It is up to the programmer
  194.       to initialize the bss segment.  The bss segment is especially
  195.       meaningful in a ROM based system where varia